from django import forms
from django.forms import ModelForm
from .fields import ThumbnailImageField
from .models import Author

# class AuthorForm(forms.Form):
#     salutation = forms.CharField(max_length=10)
#     name = forms.CharField(max_length=200)
#     sex = forms.CharField(max_length=1, choices=(('M', 'Male'), ('F', 'Female')))
#     email = forms.EmailField()
#     #headshot = forms.ImageField(upload_to='author_headshots')
#     headshot = ThumbnailImageField(upload_to='author_headshots')

class AuthorForm(ModelForm):
    class Meta:
        model = Author
        fields = ['salutation', 'name', 'sex', 'email', 'headshot',]
